<?php foreach ($res as $data){
echo '<div class="sh">'; e_h($data['name']);
echo '：</div><div class="sp">';

$arr = arr_decode($data['arr']);
$key = "attr[$data[id]][]";
$val = $data['value'] ? $data['value'] : $arr['default_val'];

// input
switch ($arr['iType']){
case 'date':
    echo '<input type="text" name="'. $key.'" value="'. htmlq($val) .'" onclick="WdatePicker()" class="Wdate" size="12" />';
	break;
case 'radio':
    $_a = nl2arr($arr['custom_val']);
	count($_a)>8 ? html::select('name="'. $key.'"', $_a, $val, null) : html::radio('name="'. $key.'"', $_a, $val);
    break;
default :
    echo '<input type="text" name="'. $key.'"  value="'. htmlq($val)  .'" />';
}
if ($data['is_m'])
 {
    echo '<a onclick="__addInput(this)">+</a> ';
 }

// note
echo '<span class="textNote">';
e_bh($arr['note']);
echo '</span>';

//end
echo '</div>';
}?>

<script>
function __addInput(o){
    var a = $(o).prev('input');
    a.clone().insertAfter(a).before('<br>');
}
</script>
